# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-actdiag
_pkgname=actdiag
pkgver=3.0.0
pkgrel=5
pkgdesc="Generate activity-diagram image file from spec-text file"
url="https://pypi.org/project/actdiag"
arch="noarch"
license="Apache-2.0"
depends="py3-funcparserlib py3-blockdiag python3"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-docutils py3-nose py3-blockdiag-tests"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	0001-assertRegexpMatches-has-been-replaced-with-assertRegx.patch"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m nose
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/actdiag/tests/
}

sha512sums="
240a687fd0c9f8ee10e66fed9ce8ca3359f3336c1623a05b1394f1444e518c1c325922eb5cd2d6d1a867876ff820b2b1b6f5eb518a6af5d688bd8116b97c9dca  actdiag-3.0.0.tar.gz
73bfe712a22d0ec77f8e2ccc0c7f64052313be5442fd513730df45f7ab27cdb6ba83fd45572c7a4b35ecdf54afbafc9820113369217ec157072366a6b221cb40  0001-assertRegexpMatches-has-been-replaced-with-assertRegx.patch
"
